//
//  NestedController.m
//  RedballBar
//
//  Created by Faith on 2024/9/10.
//

#import "NestedController.h"

@interface NestedController ()

@end

@implementation NestedController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    OuterScrollView *scrollView = [[OuterScrollView alloc] init];
    scrollView.backgroundColor = [UIColor greenColor];
    [self.view addSubview:scrollView];
    [scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view).insets(UIEdgeInsetsMake(20, 20, 20, 20));;
    }];
    scrollView.contentSize = CGSizeMake(1200, 800);
    
    UIScrollView *childScrollView = [[UIScrollView alloc] init];
    childScrollView.contentSize = CGSizeMake(600, 800);
    childScrollView.backgroundColor = [UIColor yellowColor];
    [scrollView addSubview:childScrollView];
    [childScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view).insets(UIEdgeInsetsMake(50, 50, 50, 50));
    }];
    
    scrollView.innerScrollView = childScrollView;
    
}

@end
